package com.biz.aoao.mysql.mysqlbinlogsync.extra;

import com.biz.aoao.mysql.mysqlbinlogsync.config.BinLogPositionInfo;
import com.github.shyiko.mysql.binlog.event.EventType;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;


@Component
@Slf4j
public class ConsoleSyncInfoSetting implements IBinlogSyncInfoSetting {


    @Override
    public void recordingBinLogPositon(Long serverId,String fileName, Long eventLength, Long position, EventType eventType) {
        log.info("=====================mysqlBiglong 日志位置 serverId={}, fileName={},eventLength={},position={},eventType={}",serverId,fileName,eventLength,position,eventType);
        recordingBinLogPositon(serverId,fileName,position);
    }



    @Override
    public void recordingBinLogPositon(Long serverId, String fileName, Long position) {
      //TODO  这里可以对bin log日志信息进行持久化

    }

    @Override
    public BinLogPositionInfo getCurrentBinLogPositonInfo(Long serverId) {
        //TODO 这里从持久化的信息中读取 myssql bin log的最新位置

        return null;
    }
}
